<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import=" com.six.entity.Admin" %>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>个人信息页面</title>
<style type="text/css">
.divlogin {
	margin: 120px auto 0 auto;
	min-height: 450px;
	max-width: 900px;
	padding: 40px;
	background-color: #fff;
	margin-left: auto;
	margin-right: auto;
	border-radius: 4px;
	box-sizing: border-box
}
</style>
<link rel="stylesheet" href="css/login.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="./lib/layui/layui.js" charset="utf-8"></script>
</head>

<body class="login-bg">
	<canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
	<div class="divlogin">

		<div id="darkbannerwrap"></div>
		 <%
                        HttpSession s=request.getSession();
                        if(s.getAttribute("admins_session")==null){
                        	response.sendRedirect(request.getContextPath()+"/houtai/admin_login.jsp");
                        }else{
                        	Admin a=(Admin)s.getAttribute("admins_session");
                        %>  
			<form class="layui-form"   action="">
				<div class="layui-form-item" hidden="hidden">
					<label class="layui-form-label">ID:</label>
					<div class="layui-input-inline" style="width:350px;">
						<input type="text" id="Aid" name="Aid" value="<%=a.getAid() %>" class="layui-input" readonly="true">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">姓名:</label>
					<div class="layui-input-inline" style="width:350px;">
						<input type="text" id="Aname" name="Aname" value="<%=a.getAname() %>" readonly="true" required=""  autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">密码:</label>
					<div class="layui-input-inline" style="width:350px;">
						<input type="password" id="Apassword" name="Apassword" value="<%=a.getApassword() %>" required=""  autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-btn-container" style="text-align:center;">
					<button class="layui-btn" lay-filter="formDemo" lay-submit="">
                        	修改
                    </button>
				</div>
			</form>
			<%} %>
	<script>
	//Demo
	layui.use('form', function() {
		var form = layui.form;
		 var $ = layui.jquery; //引入jquery
		//监听提交
			form.on('submit(formDemo)', function(data) {
				var d = data.field;//表单中的数据，定义一个对象来接收
				var url = '/shoppingsix/admin_update';
				$.post(url, d, function(data) {
					if(data.count>0){
						console.log('修改成功');
						layer.msg('修改成功');
						window.location.href = "admin_login.jsp";
					}
				}, "json");
				return false;
			});
	});
	</script>

	<!-- 底部结束 -->

</body>

</html>